3.4.70 \(\int \frac {(d+e x^r) (a+b \log (c x^n))}{x} \, dx\) [370]

Optimal. Leaf size=53 \[ -\frac {b e n x^r}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}+\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[Out]

-b*e*n*x^r/r^2+e*x^r*(a+b*ln(c*x^n))/r+1/2*d*(a+b*ln(c*x^n))^2/b/n

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {14, 2393, 2338, 2341} \begin {gather*} \frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}-\frac {b e n x^r}{r^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((d + e*x^r)*(a + b*Log[c*x^n]))/x,x]

[Out]

-((b*e*n*x^r)/r^2) + (e*x^r*(a + b*Log[c*x^n]))/r + (d*(a + b*Log[c*x^n])^2)/(2*b*n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2393

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Wit
h[{u = ExpandIntegrand[a + b*Log[c*x^n], (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c,
d, e, f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && IntegerQ[r]))

Rubi steps

\begin {align*} \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx &=\int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e x^{-1+r} \left (a+b \log \left (c x^n\right )\right )\right ) \, dx\\ &=d \int \frac {a+b \log \left (c x^n\right )}{x} \, dx+e \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-\frac {b e n x^r}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}+\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 51, normalized size = 0.96 \begin {gather*} -\frac {1}{2} b d n \log ^2(x)+d \log (x) \left (a+b \log \left (c x^n\right )\right )+\frac {e x^r \left (-b n+a r+b r \log \left (c x^n\right )\right )}{r^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^r)*(a + b*Log[c*x^n]))/x,x]

[Out]

-1/2*(b*d*n*Log[x]^2) + d*Log[x]*(a + b*Log[c*x^n]) + (e*x^r*(-(b*n) + a*r + b*r*Log[c*x^n]))/r^2

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.10, size = 278, normalized size = 5.25

method result size
risch \(\frac {b \left (d r \ln \left (x \right )+e \,x^{r}\right ) \ln \left (x^{n}\right )}{r}-\frac {i \mathrm {csgn}\left (i c \,x^{n}\right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \right ) d b \pi \ln \left (x \right )}{2}+\frac {i \ln \left (x \right ) \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i \ln \left (x \right ) \pi b d \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i \mathrm {csgn}\left (i c \,x^{n}\right )^{3} d b \pi \ln \left (x \right )}{2}-\frac {i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) x^{r}}{2 r}+\frac {i \pi b e \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r}}{2 r}+\frac {i \pi b e \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{r}}{2 r}-\frac {i \pi b e \mathrm {csgn}\left (i c \,x^{n}\right )^{3} x^{r}}{2 r}-\frac {b d n \ln \left (x \right )^{2}}{2}+\ln \left (x \right ) \ln \left (c \right ) b d +\ln \left (x \right ) a d +\frac {\ln \left (c \right ) b e \,x^{r}}{r}+\frac {a \,x^{r} e}{r}-\frac {b e n \,x^{r}}{r^{2}}\) \(278\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)*(a+b*ln(c*x^n))/x,x,method=_RETURNVERBOSE)

[Out]

b*(d*r*ln(x)+e*x^r)/r*ln(x^n)-1/2*I*csgn(I*c*x^n)*csgn(I*x^n)*csgn(I*c)*d*b*Pi*ln(x)+1/2*I*ln(x)*Pi*b*d*csgn(I
*c)*csgn(I*c*x^n)^2+1/2*I*ln(x)*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I*csgn(I*c*x^n)^3*d*b*Pi*ln(x)-1/2*I/r*
Pi*b*e*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*x^r+1/2*I/r*Pi*b*e*csgn(I*c)*csgn(I*c*x^n)^2*x^r+1/2*I/r*Pi*b*e*csg
n(I*x^n)*csgn(I*c*x^n)^2*x^r-1/2*I/r*Pi*b*e*csgn(I*c*x^n)^3*x^r-1/2*b*d*n*ln(x)^2+ln(x)*ln(c)*b*d+ln(x)*a*d+1/
r*ln(c)*b*e*x^r+a/r*x^r*e-b*e*n*x^r/r^2

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 56, normalized size = 1.06 \begin {gather*} \frac {b e x^{r} \log \left (c x^{n}\right )}{r} + \frac {b d \log \left (c x^{n}\right )^{2}}{2 \, n} + a d \log \left (x\right ) - \frac {b e n x^{r}}{r^{2}} + \frac {a e x^{r}}{r} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="maxima")

[Out]

b*e*x^r*log(c*x^n)/r + 1/2*b*d*log(c*x^n)^2/n + a*d*log(x) - b*e*n*x^r/r^2 + a*e*x^r/r

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 69, normalized size = 1.30 \begin {gather*} \frac {b d n r^{2} \log \left (x\right )^{2} + 2 \, {\left (b n r e \log \left (x\right ) + b r e \log \left (c\right ) - {\left (b n - a r\right )} e\right )} x^{r} + 2 \, {\left (b d r^{2} \log \left (c\right ) + a d r^{2}\right )} \log \left (x\right )}{2 \, r^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="fricas")

[Out]

1/2*(b*d*n*r^2*log(x)^2 + 2*(b*n*r*e*log(x) + b*r*e*log(c) - (b*n - a*r)*e)*x^r + 2*(b*d*r^2*log(c) + a*d*r^2)
*log(x))/r^2

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (46) = 92\).
time = 5.23, size = 131, normalized size = 2.47 \begin {gather*} \begin {cases} \left (a + b \log {\left (c \right )}\right ) \left (d + e\right ) \log {\left (x \right )} & \text {for}\: n = 0 \wedge r = 0 \\\left (d + e\right ) \left (\begin {cases} a \log {\left (x \right )} & \text {for}\: b = 0 \\- \left (- a - b \log {\left (c \right )}\right ) \log {\left (x \right )} & \text {for}\: n = 0 \\\frac {\left (- a - b \log {\left (c x^{n} \right )}\right )^{2}}{2 b n} & \text {otherwise} \end {cases}\right ) & \text {for}\: r = 0 \\\left (a + b \log {\left (c \right )}\right ) \left (d \log {\left (x \right )} + \frac {e x^{r}}{r}\right ) & \text {for}\: n = 0 \\\frac {a d \log {\left (c x^{n} \right )}}{n} + \frac {a e x^{r}}{r} + \frac {b d \log {\left (c x^{n} \right )}^{2}}{2 n} - \frac {b e n x^{r}}{r^{2}} + \frac {b e x^{r} \log {\left (c x^{n} \right )}}{r} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)*(a+b*ln(c*x**n))/x,x)

[Out]

Piecewise(((a + b*log(c))*(d + e)*log(x), Eq(n, 0) & Eq(r, 0)), ((d + e)*Piecewise((a*log(x), Eq(b, 0)), (-(-a
 - b*log(c))*log(x), Eq(n, 0)), ((-a - b*log(c*x**n))**2/(2*b*n), True)), Eq(r, 0)), ((a + b*log(c))*(d*log(x)
 + e*x**r/r), Eq(n, 0)), (a*d*log(c*x**n)/n + a*e*x**r/r + b*d*log(c*x**n)**2/(2*n) - b*e*n*x**r/r**2 + b*e*x*
*r*log(c*x**n)/r, True))

________________________________________________________________________________________

Giac [A]
time = 2.72, size = 69, normalized size = 1.30 \begin {gather*} \frac {1}{2} \, b d n \log \left (x\right )^{2} + \frac {b n x^{r} e \log \left (x\right )}{r} + b d \log \left (c\right ) \log \left (x\right ) + \frac {b x^{r} e \log \left (c\right )}{r} + a d \log \left (x\right ) - \frac {b n x^{r} e}{r^{2}} + \frac {a x^{r} e}{r} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="giac")

[Out]

1/2*b*d*n*log(x)^2 + b*n*x^r*e*log(x)/r + b*d*log(c)*log(x) + b*x^r*e*log(c)/r + a*d*log(x) - b*n*x^r*e/r^2 +
a*x^r*e/r

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\left (d+e\,x^r\right )\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((d + e*x^r)*(a + b*log(c*x^n)))/x,x)

[Out]

int(((d + e*x^r)*(a + b*log(c*x^n)))/x, x)

________________________________________________________________________________________